package set;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @Author:Cjj
 * @Date:2025/5/21
 * ArrayList 集合
 */
public class Test1 {
    public static void main(String[] args) {
        List list = new ArrayList<>();

        list.add("赵丽颖");
        list.add("小昭");
        list.add("香香");

       //创建迭代器 创建一个医生
        Iterator it = list.iterator();

        String s1=(String) it.next();
        System.out.println(s1);

        String s2 = (String) it.next();
        System.out.println(s2);

        String s3= (String) it.next();
        System.out.println(s3);

        String s4= (String) it.next();
        System.out.println(s4);//下一个 证明没下一个了


    }
}
